package com.heu.blood.match.dao;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.core.toolkit.Constants;
import com.heu.blood.match.entity.BloodMatchEntity;
import com.heu.blood.match.vo.BloodMatchRecordQueryBagDimensionVo;
import com.heu.blood.match.vo.BloodMatchRecordQueryPatientDimensionVo;
import com.heu.blood.match.vo.BloodMatchWithBloodStateVo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 
 * 
 * @author lyj
 * @email lyj@heu.com
 * @date 2023-06-16 00:23:13
 */
@Mapper
public interface BloodMatchDao extends BaseMapper<BloodMatchEntity> {
    /**
     * 分页条件联表查询患者维度的历史的配血记录进行查询
     * @param page
     * @param wrapper
     * @return
     */

    IPage<BloodMatchRecordQueryPatientDimensionVo> selectBloodMatchRecordQueryPatientDimensionPage(IPage<BloodMatchRecordQueryPatientDimensionVo> page,
                                                                                                   @Param(Constants.WRAPPER) QueryWrapper<BloodMatchRecordQueryPatientDimensionVo> wrapper);

    IPage<BloodMatchRecordQueryPatientDimensionVo> selectBloodMatchRecordQueryPatientDimensionPageByDonationCode(IPage<BloodMatchRecordQueryPatientDimensionVo> page,
                                                                                                   @Param(Constants.WRAPPER) QueryWrapper<BloodMatchRecordQueryPatientDimensionVo> wrapper);

    /**
    * @description: 分页联表查询血袋维度的历史配血记录
    * @param page
    	* @param wrapper
    * @return com.baomidou.mybatisplus.core.metadata.IPage<com.heu.blood.match.vo.BloodMatchRecordQueryBagDimensionVo>
    * @author lhh
    * @date 2024-07-17
    */

    IPage<BloodMatchRecordQueryBagDimensionVo> selectBloodMatchRecordQueryBagDimensionPage(IPage<BloodMatchRecordQueryBagDimensionVo> page,
                                                                                                   @Param(Constants.WRAPPER) QueryWrapper<BloodMatchRecordQueryBagDimensionVo> wrapper);

//    通过BloodSampleInfoTransfusionId与BloodTransfusionSample联表查询并通过bloodId与BloodInformation联表查询
    List<BloodMatchRecordQueryBagDimensionVo> selectBloodMatchRecordByBloodSampleInfoTransfusionId(String bloodSampleId);

    List<BloodMatchWithBloodStateVo> selectMatchInfoWithBloodState(BloodMatchEntity bloodMatchEntity);
}
